import axios from 'axios';
import {Component} from 'react';
// 创建axios实例
const instance=axios.create({
    baseURL:'http://localhost:3001/api'
});
// 请求拦截器
instance.interceptors.request.use(request=>{
    return request;
});
// 相应拦截器
instance.interceptors.response.use(response=>{
    return response.data;
});
Component.prototype.$axios=instance;
export default instance;